/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.biblioteca.controller;

import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class FilterChain {
    private List<IFilter> filterList = new ArrayList<IFilter>();

    public FilterChain() {
        filterList.add(new AuthenticationFilter());
    }

    public void processFilter(HttpServletRequest request, HttpServletResponse response) {
        IFilter filter;
        for (int i = 0; i < filterList.size(); i++) {
            filter = filterList.get(i);
            filter.execute(request, response);
        }
    }
}
